import { CSSProperties, ReactNode } from 'react'
import classNames from 'classnames'
import { Empty } from 'antd'

import styles from './styles.module.less'

interface IVCenterEmptyProps {
  description?: ReactNode
  style?: CSSProperties
  className?: string
}

/** 垂直居中的 Empty */
export const VCenterEmpty = Object.assign(
  ({ description, style, className }: IVCenterEmptyProps) => (
    <Empty style={style} className={classNames(styles.box, className)} description={description} />
  ),
  {
    render: (props?: IVCenterEmptyProps) => <VCenterEmpty {...props} />,
  },
)
